


<template>
    <div class="model-form">
        <el-page-header @back="goBack" content="增加">
        </el-page-header>
        <div class="model-content">
            <el-form ref="ruleForm" :rules="rules" :model="form" label-width="160px">
                <el-row :gutter="10">
    <el-col :span="12">
            <el-form-item label="文件名称"  prop="name">
        <el-input v-model="form.name" name="name">
        </el-input>
            </el-form-item>

    </el-col>
    <el-col :span="12">
            <el-form-item label="文件截图"  prop="logo">
        <avatar v-model="form.logo"></avatar>
            </el-form-item>

    </el-col>
    <el-col :span="12">
            <el-form-item label="文件地址"  prop="downUrl">
        <avatar v-model="form.downUrl"></avatar>
            </el-form-item>

    </el-col>
    <el-col :span="12">
            <el-form-item label="内容"  prop="note">
        <el-input v-model="form.note" name="note" type="textarea"></el-input>
            </el-form-item>

    </el-col>

                    <el-col :span="22">
                        <el-form-item>
                            <el-button @click="goBack">取消</el-button>
                            <el-button type="primary" @click="createData">确定</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script setup>
        import avatar from "@/components/avatar.vue";
    import {ref} from "vue";
    import {useData} from "@/utils/useData";
    import {useCreate} from "@/uses/useCreate";

    const form = ref({
         name: null ,
         logo: null ,
         downUrl: null ,
         note: null     })

    const rules = ref({
       name: [
           {required: true, message: '请输入文件名称', trigger: 'blur'}
       ],
    })

    const ruleForm = ref(null);

    const {createData,goBack} =useCreate("downFile",form,ruleForm)

</script>

<style scoped>
</style>